package com.lhnstart.learn.bases.codeblock_;

/**
 * 代码块详解
 *
 * @author lhn
 * @date 2023/07/12 10:47
 * @since 1.0.0
 **/
public class CodeBlock1 {

    public static void main(String[] args) {
        Movie movie = new Movie("我不是药神");
    }

}

class Movie {

    String name;

    double price;

    String director;

    {
        System.out.println("1");
        System.out.println(2);
        System.out.println(3);
    }

    public Movie(String name) {
        System.out.println(4);
        this.name = name;
    }

    public Movie(String name, double price) {
        this.name = name;
        this.price = price;
    }

    public Movie(String name, double price, String director) {
        this.name = name;
        this.price = price;
        this.director = director;
    }
}